package com.cloud.oss.minio.config;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.time.Duration;

/**
 * @author wangjian
 * @version 1.0.0
 * @create 2020年11月11日 10:20
 * @since JDK 1.8
 * Life is so short,do something to make yourself happy,such as coding
 */
@ConfigurationProperties(prefix = "spring.cloud.minio")
public class MinioConfigurationProperties {

    private String url;
    private int port = 0;
    private String accessKey;
    private String secretKey;
    private String bucket;
    /**
     * secure选项（是否使用https）
     */
    private boolean secure = true;

    /**
     * 是否跳过ssl验证
     */
    private boolean skipSsl = false;

    /**
     * 是否检查bucket是否存在
     */
    private boolean checkBucket = true;

    /**
     * 默认链接客户端超时时间 10s
     */
    private Duration connectTimeout = Duration.ofSeconds(10);

    /**
     * 默认写入超时时间 60s
     */
    private Duration writeTimeout = Duration.ofSeconds(60);

    /**
     * 默认读取超时时间 10s
     */
    private Duration readTimeout = Duration.ofSeconds(10);

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public int getPort() {
        return port;
    }

    public void setPort(int port) {
        this.port = port;
    }

    public boolean isSkipSsl() {
        return skipSsl;
    }

    public void setSkipSsl(boolean skipSsl) {
        this.skipSsl = skipSsl;
    }

    public String getAccessKey() {
        return accessKey;
    }

    public void setAccessKey(String accessKey) {
        this.accessKey = accessKey;
    }

    public String getSecretKey() {
        return secretKey;
    }

    public void setSecretKey(String secretKey) {
        this.secretKey = secretKey;
    }

    public String getBucket() {
        return bucket;
    }

    public void setBucket(String bucket) {
        this.bucket = bucket;
    }

    public boolean isSecure() {
        return secure;
    }

    public void setSecure(boolean secure) {
        this.secure = secure;
    }

    public boolean isCheckBucket() {
        return checkBucket;
    }

    public void setCheckBucket(boolean checkBucket) {
        this.checkBucket = checkBucket;
    }

    public Duration getConnectTimeout() {
        return connectTimeout;
    }

    public void setConnectTimeout(Duration connectTimeout) {
        this.connectTimeout = connectTimeout;
    }

    public Duration getWriteTimeout() {
        return writeTimeout;
    }

    public void setWriteTimeout(Duration writeTimeout) {
        this.writeTimeout = writeTimeout;
    }

    public Duration getReadTimeout() {
        return readTimeout;
    }

    public void setReadTimeout(Duration readTimeout) {
        this.readTimeout = readTimeout;
    }
}
